import React,{Suspense} from 'react';
import { Redirect, Route, Router, Switch } from 'react-router-dom';

const PageIndex = React.lazy(() => import('../pages/index'));


export default (props: { history: any }) => {
  return (
    <Router history={props.history}>
      <Suspense fallback={() => <div />}>
        <Switch>
          <Route exact component={PageIndex} path="/" />
          <Redirect path="*" to="/" />
        </Switch>
      </Suspense>
    </Router>
  );
};
